package hlhj.fhp.supreme.customview

import android.content.Context
import android.view.LayoutInflater
import android.widget.LinearLayout
import android.widget.PopupWindow
import hlhj.fhp.supreme.R
import kotlinx.android.synthetic.main.choose_getcash_pop.view.*

/**
 * Created by Administrator on 2018\6\8 0008.
 */
class ChooseGetCashPop(private val context: Context,private val listener:OnChooseGetCashListener) :PopupWindow(){
    init {
        this.isFocusable=true
        this.isOutsideTouchable=false
        this.width=LinearLayout.LayoutParams.MATCH_PARENT
        this.height=LinearLayout.LayoutParams.WRAP_CONTENT
        animationStyle=R.style.getCash_pop_style
        setPop()
    }

    private fun setPop() {
        contentView=LayoutInflater.from(context).inflate(R.layout.choose_getcash_pop,null)
        contentView.btCancel.setOnClickListener {
            dismiss()
        }

        contentView.btAli.setOnClickListener {
            listener.onAli()
            dismiss()
        }
        contentView.btBank.setOnClickListener {
            listener.onBank()
            dismiss()
        }

    }

    interface OnChooseGetCashListener{
        fun onAli()
        fun onBank()
    }
}